﻿#region copyright
/*
* Copyright (c) 2009, Dion Kurczek
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*     * Redistributions of source code must retain the above copyright
*       notice, this list of conditions and the following disclaimer.
*     * Redistributions in binary form must reproduce the above copyright
*       notice, this list of conditions and the following disclaimer in the
*       documentation and/or other materials provided with the distribution.
*     * Neither the name of the <organization> nor the
*       names of its contributors may be used to endorse or promote products
*       derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY DION KURCZEK ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL DION KURCZEK BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#endregion
using System;
using System.Net;
using System.Collections.Generic;

namespace SCG.Prism
{
    //Event argument classes used by PrismConnection
    public class MessageEventArgs : EventArgs
    {
        private string _msg;

        public MessageEventArgs(string msg)
        {
            _msg = msg;
        }

        public string Msg
        {
            get
            {
                return _msg;
            }
        }
    }
    public class CustomCommandEventArgs : EventArgs
    {
        private string _commandName;
        private string _params;

        public CustomCommandEventArgs(string commandString, string cmdParams)
        {
            _commandName = commandString;
            _params = cmdParams;
        }

        public string CommandString
        {
            get
            {
                return _commandName;
            }
        }
        public string Params
        {
            get
            {
                return _params;
            }
        }
    }
    public class RoomNameEventArgs : EventArgs
    {
        private string _roomName;

        public RoomNameEventArgs(string roomName)
        {
            _roomName = roomName;
        }

        public string RoomName
        {
            get
            {
                return _roomName;
            }
        }
    }
    public class RoomCountEventArgs : RoomNameEventArgs
    {
        public RoomCountEventArgs(string roomName, int count)
            : base(roomName)
        {
            _count = count;
        }

        public int Count
        {
            get
            {
                return _count;
            }
        }

        private int _count;
    }
    public class RoomInfoEventArgs : EventArgs
    {
        public RoomInfoEventArgs(List<RoomInfo> rooms)
            : base()
        {
            _rooms = rooms;
        }

        public List<RoomInfo> Rooms
        {
            get
            {
                return _rooms;
            }
        }

        private List<RoomInfo> _rooms;
    }

    public class PrismUserEventArgs : EventArgs
    {
        private PrismUser _user;

        public PrismUserEventArgs(PrismUser user)
        {
            _user = user;
        }

        public PrismUser User
        {
            get
            {
                return _user;
            }
        }
    }

    public class PrismUserMessageEventArgs : EventArgs
    {
        private PrismUser _user;
        private string _msg;

        public PrismUserMessageEventArgs(PrismUser user, string msg)
        {
            _user = user;
            _msg = msg;
        }

        public PrismUser User
        {
            get
            {
                return _user;
            }
        }

        public string Msg
        {
            get
            {
                return _msg;
            }
        }
    }

    public class PrismServerStatsEventArgs : EventArgs
    {
        //Private members
        private PrismServerStats _stats;

        //Constructor
        public PrismServerStatsEventArgs(PrismServerStats stats)
        {
            _stats = stats;
        }

        //Public peoperties
        public PrismServerStats ServerStats
        {
            get
            {
                return _stats;
            }
        }
    }

    //event handler for passing orders back
    public class OrdersEventArgs : EventArgs
    {
        //public members

        //constructor
        public OrdersEventArgs()
        {
        }

        //access the orders returned
        public string Orders
        {
            get
            {
                return _orders;
            }
            set
            {
                _orders = value;
            }
        }

        //private members
        private string _orders = "";
    }

    //event handler for processing orders and returning state changes
    public class ProcessOrdersEventArgs : EventArgs
    {
        //constructor
        public ProcessOrdersEventArgs(List<string> orders)
        {
            _orders = orders;
        }

        //access the list of orders
        public List<string> Orders
        {
            get
            {
                return _orders;
            }
        }

        //access/change the state change string
        public string StateChanges
        {
            get
            {
                return _stateChanges;
            }
            set
            {
                _stateChanges = value;
            }
        }

        //private members
        private List<string> _orders = null;
        private string _stateChanges = null;
    }
}
